<!--
 * @Author: Zhang Lei
 * @Date: 2021-06-29 22:11:11
 * @LastEditTime: 2021-07-02 16:22:40
 * @LastEditors: Zhang Lei
 * @Description: 
 * @FilePath: \xxtx-client-ui\src\views\Project.vue
 * 下面绝对无bug，确信！
-->
<template>
  <div class="article_container">
    <!-- 3. 引用 -->
    <!-- 头部 -->
    <Header></Header>
    <!-- 文章内容 -->
    <div class="article">
      <div class="name">{{project.name}}</div>
      <div class="info">
        {{project.beginTime}} ~ {{project.endTime}}
        <span> {{project.teachear?project.teachear.realname:""}} </span>
      </div>

      <div class="details" v-html="project.details"></div>
    </div>
  </div>
</template>
<script>
import {get} from '../utils/request'
// 1. 导入
import Header from './components/Header'
export default {
  // 2. 注册
  components:{
    Header
  },
  data(){
    return {
      project :{}
    }
  },
  created(){
    // 1.获取项目id
    let projectId =this.$route.query.projectId;
    // 2.通过项目id查询项目
    let url = "/index/project/findById"
    let param = {id:projectId}
    get(url,param).then(resp => {
      this.project = resp.data;
    })
    // 3.展示到页面中
  }
}
</script>

<style>
.article img {
  width: 100% !important;
  margin: .5em 0;
}
</style>
<style lang="scss" scoped>
.article_container {
  .article {
    width: 90%;
    margin: 0 auto;
    img {
      width: 100%;
      margin: .5em 0;
    }
    .name {
      font-weight: bolder;
      font-size: 18px;
      line-height: 2em;
      text-align: center;
    }
    .info {
      text-align: center;
    }
    
  }
}
</style>
